﻿package  {
	import flash.text.*;
	import flash.display.*
	
	public class TextDisplay extends Sprite {

		private var tf:TextField;
		private var textFormat:TextFormat;
		
		private var description:String;
		
		//
		public static const X_OFFSET = 20; 
		
		//======================================================
		
		public function TextDisplay(description:String) {
			this.description = description;
			
			// this isn't working :(
			textFormat = new TextFormat();
			textFormat.font = "Arial";
			textFormat.size = 48;
			
			tf = new TextField();
			tf.x = X_OFFSET;
			tf.selectable = false;
			
			addChild(tf);
			
			tf.setTextFormat(textFormat);
		}
		
		public function showText():void
		{
			tf.text = description;
		}
		
		public function hideText():void
		{
			tf.text = "";
		}
	}
	
}
